/*
 * Copyright (C) 2017 yixun All Rights Reserved.
 * 
 * CommissionDto.java
 */
package com.yixun.qfbao.model.dto;

import com.yixun.qfbao.model.ReportCommission;

import java.util.Date;
import java.util.LinkedList;
import java.util.List;

/**
 *  佣金汇总信息
 * 
 * @author 陶俊代码生成器
 * @version 1.00
 */
public class CommissionSummaryDto extends ReportCommission {
	private static final long serialVersionUID = 1L;
	/**
	 *需要正序字段名
	 */
	private List<String> asc;
	/**
	 *需要逆序字段名
	 */
	private List<String> desc;
	/**
	 *排序SQL
	 */
	private String orders;
    /*********
     * 扩展字段
     * *******
     */
	/**
	 * 合作机构佣金是否结清：1：是， 0,2 否
	 */
	private String agentIsSettle;

	/**
	 *  开发商佣金是否结清：1：是， 0,2 否
	 */
	private String devIsSettle;
	/**
	 * 合作机构名称
	 */
	private String agentCompanyName;
	/**
	 * 楼盘名称
	 */
	private String premisesName;
	/**
	 *成交套数
	 */
	private String dealNum;
	/**
	 * 待结算日期
	 */
	private String pendingDateStr;
	/**
	 * 实际结佣日期
	 */
	private String actualDateStr;
	/**
	 * 控制结算佣金按钮显示（1-显示，0-隐藏）
	 */
	private String pendingBtn;
	/**
	 * 扩展sql
	 * 
	 */
	private String sql;
	public String getSql() {
		return sql;
	}

	public void setSql(String sql) {
		this.sql = sql;
	}
	/**
	 * 结佣操作人的姓名
	 */
	private String settmentUserName;
    public String getSettmentUserName() {
		return settmentUserName;
	}

	public void setSettmentUserName(String settmentUserName) {
		this.settmentUserName = settmentUserName;
	}

	public String getPendingBtn() {
		return pendingBtn;
	}

	public void setPendingBtn(String pendingBtn) {
		this.pendingBtn = pendingBtn;
	}

	public String getPendingDateStr() {
		return pendingDateStr;
	}

	public void setPendingDateStr(String pendingDateStr) {
		this.pendingDateStr = pendingDateStr;
	}

	public String getActualDateStr() {
		return actualDateStr;
	}

	public void setActualDateStr(String actualDateStr) {
		this.actualDateStr = actualDateStr;
	}

	public String getAgentCompanyName() {
		return agentCompanyName;
	}

	public void setAgentCompanyName(String agentCompanyName) {
		this.agentCompanyName = agentCompanyName;
	}

	public String getPremisesName() {
		return premisesName;
	}

	public void setPremisesName(String premisesName) {
		this.premisesName = premisesName;
	}

	/**
	 *  添加需要正序字段名
	 */
	public void addAsc(String col){
		if(asc==null){
			asc = new LinkedList<String>();
		}
		asc.add(col);
	}
	
	/**
	 *  清空需要正序字段名
	 */
	public void cleanAsc(){
		asc = null;
	}
	
	/**
	 *  添加需要逆序字段名
	 */
	public void addDesc(String col){
		if(desc==null){
			desc = new LinkedList<String>();
		}
		desc.add(col);
	}
	
	/**
	 *  清空需要逆序字段名
	 */
	public void cleanDesc(){
		desc = null;
	}
	
	/**
	 *  如果排序SQL为空根据需要正逆序的字段名拼接排序SQL
	 */
	public String  getOrders() {
		StringBuilder orderStr = null;
		StringBuilder ascStr;
		StringBuilder descStr;
		if(orders==null){
			if(asc!=null){
				ascStr = new StringBuilder();
				orderStr = new StringBuilder();
				String pex = "";
				for(String a : asc){
					ascStr.append(pex+a);
					pex = ",";
				}
				orderStr.append(ascStr.toString()+" ASC");
			}
			if(desc!=null){
				descStr = new StringBuilder();
				String pex = "";
				for(String d : desc){
					descStr.append(pex+d);
					pex = ",";
				}
				if(orderStr==null){
					orderStr = new StringBuilder();
					orderStr.append(descStr.toString()+" DESC");
				}else{
					orderStr.append(","+descStr.toString()+" DESC");
				}
			}
			orders = orderStr!=null?orderStr.toString():null;
		}
		
		return orders;
	}
	
	/**
	 *  设置排序SQL
	 */
	public void setOrders(String orders) {
		this.orders = orders;
	}
	private Date updateTimeBefore;
	private Date updateTimeAfter;
	private Date createTimeBefore;
	private Date createTimeAfter;

	private List<Long> agencyDeptIds;


    public Date getUpdateTimeBefore() {
        return this.updateTimeBefore;
    }
    public void setUpdateTimeBefore(Date updateTimeBefore) {
        this.updateTimeBefore = updateTimeBefore;
    }

    public Date getUpdateTimeAfter() {
        return this.updateTimeAfter;
    }
    public void setUpdateTimeAfter(Date updateTimeAfter) {
        this.updateTimeAfter = updateTimeAfter;
    }

    public Date getCreateTimeBefore() {
        return this.createTimeBefore;
    }
    public void setCreateTimeBefore(Date createTimeBefore) {
        this.createTimeBefore = createTimeBefore;
    }

    public Date getCreateTimeAfter() {
        return this.createTimeAfter;
    }
    public void setCreateTimeAfter(Date createTimeAfter) {
        this.createTimeAfter = createTimeAfter;
    }

	public String getAgentIsSettle() {
		return agentIsSettle;
	}

	public void setAgentIsSettle(String agentIsSettle) {
		this.agentIsSettle = agentIsSettle;
	}

	public String getDealNum() {
		return dealNum;
	}

	public void setDealNum(String dealNum) {
		this.dealNum = dealNum;
	}

	public String getDevIsSettle() {
		return devIsSettle;
	}

	public void setDevIsSettle(String devIsSettle) {
		this.devIsSettle = devIsSettle;
	}

	public List<Long> getAgencyDeptIds() {
		return agencyDeptIds;
	}

	public void setAgencyDeptIds(List<Long> agencyDeptIds) {
		this.agencyDeptIds = agencyDeptIds;
	}
}
